home *** CD-ROM | disk | FTP | other *** search
/ Champak 139 / (Vol 139) Sep 24 2011.iso / Games / kirby.swf / scripts / frame_12 / PlaceObject2_263_206 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-09-24  |  31KB  |  1,045 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.setvarsoff == "on")
  3.    {
  4.       JumpDown = "off";
  5.       normMainSpeed = 7;
  6.       Jumpspeed = 15;
  7.       Jumptime = 5;
  8.       YSpeed = 0;
  9.       isjumping = "off";
  10.       isAttacking = "off";
  11.       normGravity = 3;
  12.       normMaxYSpeed = 10;
  13.       YSpeed = 0;
  14.       YSpeed = 0;
  15.       isjumping = "off";
  16.       isAttacking = "off";
  17.       Fly = "off";
  18.       Fat = "off";
  19.       spit = "off";
  20.       Spiting = "off";
  21.       CSPattack = "off";
  22.       attackdemo = "off";
  23.       hit = "off";
  24.       _root.setvarsoff = "off";
  25.       UpDownDoor = "on";
  26.    }
  27.    if(_root.Movheight < this._y + _root.Level._y)
  28.    {
  29.       Die = "on";
  30.    }
  31.    if(Die == "on")
  32.    {
  33.       if(_root.Movheight + 100 < this._y)
  34.       {
  35.          if(_root.Levelchange._currentframe < 50)
  36.          {
  37.             _root.Levelchange.gotoAndPlay(50);
  38.          }
  39.       }
  40.       DY -= 0.5;
  41.       this._y -= DY;
  42.       hit = "on";
  43.       _root.DieS.gotoAndStop(2);
  44.    }
  45.    else
  46.    {
  47.       _root.DieS._x = this._x;
  48.       _root.DieS._y = this._y;
  49.    }
  50.    if(Fly == "on")
  51.    {
  52.       Gravity = normGravity / 10;
  53.       MaxYspeed = normMaxYSpeed / 2;
  54.       MainSpeed = normMainSpeed / 3;
  55.    }
  56.    else if(hit == "on2")
  57.    {
  58.       Gravity = normGravity / 5;
  59.       MaxYspeed = normMaxYSpeed;
  60.       MainSpeed = normMainSpeed;
  61.    }
  62.    else if(CSPattack == "stone")
  63.    {
  64.       Gravity = normGravity * 2;
  65.       MaxYspeed = normMaxYSpeed * 2;
  66.       MainSpeed = normMainSpeed;
  67.    }
  68.    else
  69.    {
  70.       Gravity = normGravity;
  71.       MaxYspeed = normMaxYSpeed;
  72.       MainSpeed = normMainSpeed;
  73.    }
  74.    if(hit == "off")
  75.    {
  76.       if(Key.isDown(left) && isAttacking == "off")
  77.       {
  78.          this._xscale = -100;
  79.          if(X < - normMainspeed / 2 && Dirdown2 == "off" && Ground == "on")
  80.          {
  81.             run = "on";
  82.          }
  83.          Dirdown2 = "on";
  84.          if(run == "on")
  85.          {
  86.             Speed = (- MainSpeed) * 1.5;
  87.          }
  88.          else
  89.          {
  90.             Speed = - MainSpeed;
  91.          }
  92.       }
  93.       else if(Key.isDown(right) && isAttacking == "off")
  94.       {
  95.          this._xscale = 100;
  96.          if(0 + normMainspeed / 2 < X && Dirdown2 == "off" && Ground == "on")
  97.          {
  98.             run = "on";
  99.          }
  100.          Dirdown2 = "on";
  101.          if(run == "on")
  102.          {
  103.             Speed = MainSpeed * 1.5;
  104.          }
  105.          else
  106.          {
  107.             Speed = MainSpeed;
  108.          }
  109.       }
  110.       else
  111.       {
  112.          if(Dirdown2 == "on")
  113.          {
  114.             DirDownZ = 5;
  115.             Dirdown2 = "off";
  116.          }
  117.          if(DirdownZ >= 0)
  118.          {
  119.             DirdownZ -= 1;
  120.          }
  121.          else
  122.          {
  123.             Dirdown2 = "on2";
  124.          }
  125.          run = "off";
  126.          Dirdown = "off";
  127.          Speed = 0;
  128.       }
  129.    }
  130.    if(Key.isDown(attack) && Spiting == "off")
  131.    {
  132.       if(Attackdemo == "off" && hit == "off")
  133.       {
  134.          if(SPAttack != "off" && CSPattack == "off" && Fly == "off")
  135.          {
  136.             if(SPattack == "Sword")
  137.             {
  138.                if(AttackDown2 == "off")
  139.                {
  140.                   if(Ground == "on")
  141.                   {
  142.                      CSPAttack = "Sword";
  143.                   }
  144.                   else
  145.                   {
  146.                      CSPAttack = "SwordJump";
  147.                   }
  148.                }
  149.             }
  150.             else if(SPattack == "Crash")
  151.             {
  152.                if(AttackDown2 == "off")
  153.                {
  154.                   CSPAttack = SPattack;
  155.                }
  156.             }
  157.             else
  158.             {
  159.                CSPAttack = SPattack;
  160.             }
  161.          }
  162.          else if(AttackDown == "off")
  163.          {
  164.             if(Fly == "on" && AttackDown2 == "off" && CSPattack == "off")
  165.             {
  166.                if(YSpeed < 0)
  167.                {
  168.                   YSpeed = 0;
  169.                }
  170.                Fly = "on2";
  171.             }
  172.             else if(Fat == "on")
  173.             {
  174.                spit = "on";
  175.             }
  176.             else if(SPattack != "off")
  177.             {
  178.                if(CSPattack != "SwordJump")
  179.                {
  180.                   isAttacking = "on";
  181.                }
  182.             }
  183.             else
  184.             {
  185.                isAttacking = "on";
  186.                Z = 0;
  187.                var forvar = 1;
  188.                while(20 >= forvar)
  189.                {
  190.                   if(this.Kirby.inhale.hitTest(_root.Level.SPAStar) && _root.Level.SPAStar._currentframe == 1)
  191.                   {
  192.                      _root.Level.SPAStar.Y = 0;
  193.                      _root.Level.SPAStar.X = 0;
  194.                      Spiting = "SPAStar";
  195.                      AttackDown = "on";
  196.                      forvar = 50;
  197.                   }
  198.                   if(Z == 0)
  199.                   {
  200.                      if(this.Kirby.inhalenear.hitTest(_root.Level["Enemy" add forvar]) && _root.Level["Enemy" add forvar]._visible == 1)
  201.                      {
  202.                         Spiting = "Enemy" add forvar;
  203.                         AttackDown = "on";
  204.                         forvar = 50;
  205.                      }
  206.                      else if(this.Kirby.inhalenear.hitTest(_root.Level["B" add forvar]) && _root.Level["B" add forvar]._visible == 1)
  207.                      {
  208.                         Spiting = "B" add forvar;
  209.                         AttackDown = "on";
  210.                         forvar = 50;
  211.                      }
  212.                   }
  213.                   else if(this.Kirby.inhale.hitTest(_root.Level["Enemy" add forvar]) && _root.Level["Enemy" add forvar]._visible == 1)
  214.                   {
  215.                      Spiting = "Enemy" add forvar;
  216.                      AttackDown = "on";
  217.                      forvar = 50;
  218.                   }
  219.                   else if(this.Kirby.inhale.hitTest(_root.Level["B" add forvar]) && _root.Level["B" add forvar]._visible == 1)
  220.                   {
  221.                      Spiting = "B" add forvar;
  222.                      AttackDown = "on";
  223.                      forvar = 50;
  224.                   }
  225.                   if(forvar == 20 && Z == 0)
  226.                   {
  227.                      Z = 1;
  228.                      forvar = 0;
  229.                   }
  230.                   forvar++;
  231.                }
  232.             }
  233.          }
  234.       }
  235.       AttackDown2 = "on";
  236.    }
  237.    else
  238.    {
  239.       AttackDown2 = "off";
  240.       if(!(CSPAttack == "off" || CSPattack == "Crash"))
  241.       {
  242.          if(CSPattack != "off")
  243.          {
  244.             if(Ground == "on")
  245.             {
  246.                CSPAttack = "on2";
  247.             }
  248.          }
  249.          else
  250.          {
  251.             CSPAttack = "on2";
  252.          }
  253.       }
  254.       if(Spiting == "off")
  255.       {
  256.          AttackDown = "off";
  257.          if(isAttacking == "on")
  258.          {
  259.             isAttacking = "on2";
  260.          }
  261.       }
  262.       else if(_root.Level[spiting].hitTest(this.feet))
  263.       {
  264.          isAttacking = "off";
  265.          AttackDown = "on";
  266.          fat = "on";
  267.          if(3 < _root.Level[spiting].SPattack.length)
  268.          {
  269.             MSPattack = _root.Level[spiting].SPattack;
  270.          }
  271.          else
  272.          {
  273.             MSPattack = "off";
  274.          }
  275.          _root.Level[spiting].Enemy.On = "off2";
  276.          _root.Level[spiting]._visible = 0;
  277.          Spiting = "off";
  278.       }
  279.       else
  280.       {
  281.          isAttacking = "on";
  282.          _root.Level[spiting]._y -= (_root.Level[spiting]._y + _root.Level._y - this._y) / 5;
  283.          _root.Level[spiting]._x -= (_root.Level[spiting]._x + _root.Level._x - this._x) / 5;
  284.       }
  285.    }
  286.    if(Key.isDown(up) && Fly != "on2" && Fat != "on" && Attackdemo == "off" && Spiting == "off" && isAttacking == "off" && CSPattack != "SwordJump" || Key.isDown(Jump) && Fly != "on2" && Fat != "on" && Attackdemo == "off" && Spiting == "off" && isAttacking == "off" && CSPattack != "SwordJump" && JumpDown == "off" && Ground == "off")
  287.    {
  288.       if(UpDownDoor != "on")
  289.       {
  290.          if(CSPattack == "off")
  291.          {
  292.             if(Fly == "on")
  293.             {
  294.                this.Kirby.play();
  295.             }
  296.             isjumping = "on";
  297.             Fly = "on";
  298.             YSpeed = FlySpeed;
  299.             UpDown = "on";
  300.          }
  301.          else if(SPattack != "Sword")
  302.          {
  303.             CSPattack = "on2";
  304.          }
  305.       }
  306.    }
  307.    else
  308.    {
  309.       UpDownDoor = "off";
  310.    }
  311.    if(Attackdemo == "off")
  312.    {
  313.       if(Key.isDown(Jump))
  314.       {
  315.          if(isAttacking == "off")
  316.          {
  317.             if(Ground == "on" && JumpDown == "off")
  318.             {
  319.                isjumping = "on";
  320.                YSpeed = Jumpspeed;
  321.             }
  322.             if(0 < YSpeed && isJumping == "on")
  323.             {
  324.                YSpeed += Gravity / 2;
  325.             }
  326.             JumpDown = "on";
  327.          }
  328.       }
  329.       else
  330.       {
  331.          if(0 < JumpTimeZ && JumpTimeZ != Jumptime)
  332.          {
  333.          }
  334.          JumpTimeZ = Jumptime;
  335.          JumpDown = "off";
  336.       }
  337.    }
  338.    if(Attackdemo == "off")
  339.    {
  340.       if(Key.isDown(SPout) && fat == "off" && Fly == "off" && CSPattack == "off" && SPattack != "off" || SPhitout == "on")
  341.       {
  342.          _root.Level.SPAStar._x = this._x - _root.Level._x;
  343.          _root.Level.SPAStar._y = this._y - _root.Level._y - 50;
  344.          _root.Level.SPAStar.Y = 10;
  345.          _root.Level.SPAStar._visible = 1;
  346.          _root.Level.SPAStar.gotoAndStop(1);
  347.          _root.Level.SPAStar.VisZ = this.SPAStarVisZ;
  348.          if(0 < this._xscale)
  349.          {
  350.             _root.Level.SPAStar.X = -10;
  351.          }
  352.          else
  353.          {
  354.             _root.Level.SPAStar.X = 10;
  355.          }
  356.          _root.Level.SPAStar.SPattack = SPattack;
  357.          SPattack = "off";
  358.          SPhitout = "off";
  359.       }
  360.    }
  361.    if(Attackdemo == "off")
  362.    {
  363.       if(Key.isDown(down))
  364.       {
  365.          if(spiting == "off" && isattacking == "off" && Speed == 0 && Ground == "on" && CSPattack == "off")
  366.          {
  367.             YForm = 50;
  368.             if(fat == "on")
  369.             {
  370.                if(MSPattack != "off")
  371.                {
  372.                   SPattack = MSPattack;
  373.                   Attackdemo = SPattack;
  374.                   CSPattack = "off";
  375.                   MSPattack = "off";
  376.                }
  377.                fat = "off";
  378.             }
  379.          }
  380.       }
  381.    }
  382.    if(hit != "on4")
  383.    {
  384.       if(Speed < X)
  385.       {
  386.          X -= MinusX;
  387.       }
  388.       else if(X < Speed)
  389.       {
  390.          X += MinusX;
  391.       }
  392.    }
  393.    if(Attackdemo == "off" && Die != "on")
  394.    {
  395.       this._x += X;
  396.    }
  397.    if(MaxYSpeed < YSpeed)
  398.    {
  399.       this._y -= MaxYSpeed;
  400.    }
  401.    else if(YSpeed < - MaxYSpeed)
  402.    {
  403.       this._y += MaxYSpeed;
  404.    }
  405.    else
  406.    {
  407.       this._y -= YSpeed;
  408.    }
  409.    if(Ground == "off")
  410.    {
  411.       YSpeed -= Gravity;
  412.    }
  413.    Ground = "off";
  414.    var forvar = 1;
  415.    while(forvar < 20)
  416.    {
  417.       if(this.hit2.hitTest(_root.Level["Enemy" add forvar]))
  418.       {
  419.          if(CSPattack == "elektro" || CSPattack == "stone" || CSPattack == "Spikes")
  420.          {
  421.             if(this.Kirby._currentframe >= 9)
  422.             {
  423.                _root.Level["Enemy" add forvar]._visible = 0;
  424.             }
  425.          }
  426.          else
  427.          {
  428.             _root.Level["Enemy" add forvar]._visible = 0;
  429.          }
  430.       }
  431.       if(_root.Level["Enemy" add forvar]._visible == 1 && "Enemy" add forvar != spiting)
  432.       {
  433.          if(_root.Starshoot.hitTest(_root.Level["Enemy" add forvar]) || _root.Puhh.hitTest(_root.Level["Enemy" add forvar]))
  434.          {
  435.             _root.Level["Enemy" add forvar]._visible = 0;
  436.             _root.Starshoot.Star.gotoAndStop(3);
  437.             _root.Puhh.gotoAndStop(20);
  438.          }
  439.          if(this.feet.hitTest(_root.Level["Enemy" add forvar]))
  440.          {
  441.             if(hit == "off")
  442.             {
  443.                if(CSPattack == "Crash")
  444.                {
  445.                   _root.Level["Enemy" add forvar]._visible = 0;
  446.                }
  447.                else if(CSPattack != "stone")
  448.                {
  449.                   _root.Level["Enemy" add forvar]._visible = 0;
  450.                   hit = "on";
  451.                }
  452.             }
  453.          }
  454.       }
  455.       if(_root.Level["B" add forvar]._visible == 1 && "B" add forvar != spiting)
  456.       {
  457.          if(_root.Starshoot.hitTest(_root.Level["B" add forvar]) || _root.Puhh.hitTest(_root.Level["B" add forvar]))
  458.          {
  459.             Blockpuff(forvar);
  460.             _root.Level["B" add forvar]._visible = 0;
  461.             _root.Starshoot.Star.gotoAndStop(3);
  462.             _root.Puhh.gotoAndStop(20);
  463.          }
  464.          if(_root.Level.SPAStar.hitTest(_root.Level["B" add forvar]))
  465.          {
  466.             if(_root.Level["B" add forvar]._y - _root.Level["B" add forvar]._height / 2 >= _root.Level.SPAStar.LY - 10 && _root.Level.SPAStar.LX >= _root.Level["B" add forvar]._x - _root.Level["B" add forvar]._width && _root.Level.SPAStar.LX < _root.Level["B" add forvar]._x + _root.Level["B" add forvar]._width)
  467.             {
  468.                if(0 >= _root.Level.SPAStar.Y)
  469.                {
  470.                   _root.Level.SPAStar._y = _root.Level["B" add forvar]._y - _root.Level["B" add forvar]._height / 2 - _root.Level.SPAStar._height / 2;
  471.                   _root.Level.SPAStar.Y *= - SPAStarBreak;
  472.                }
  473.             }
  474.             else if(_root.Level.SPAStar.LY >= _root.Level["B" add forvar]._y + _root.Level["B" add forvar]._height / 2 && _root.Level["B" add forvar]._x - _root.Level["B" add forvar]._width < _root.Level.SPAStar.LX && _root.Level.SPAStar.LX < _root.Level["B" add forvar]._x + _root.Level["B" add forvar]._width)
  475.             {
  476.                _root.Level.SPAStar._y = _root.Level["B" add forvar]._y + _root.Level["B" add forvar]._height / 2 + _root.Level.SPAStar._width / 2 + 5;
  477.                _root.Level.SPAStar.Y *= - SPAStarBreak;
  478.             }
  479.             else if(_root.Level["B" add forvar]._y - _root.Level["B" add forvar]._height / 2 < _root.Level.SPAStar.LY && _root.Level.SPAStar.LY < _root.Level["B" add forvar]._y + _root.Level["B" add forvar]._height / 2)
  480.             {
  481.                if(_root.Level.SPAStar.LX < _root.Level["B" add forvar]._x)
  482.                {
  483.                   _root.Level.SPAStar._x = _root.Level["B" add forvar]._x - _root.Level["B" add forvar]._width / 2 - this.feet._width / 2;
  484.                   _root.Level.SPAStar.X *= - SPAStarBreak;
  485.                }
  486.                else
  487.                {
  488.                   _root.Level.SPAStar._x = _root.Level["B" add forvar]._x + _root.Level["B" add forvar]._width / 2 + this.feet._width / 2;
  489.                   _root.Level.SPAStar.X *= - SPAStarBreak;
  490.                }
  491.             }
  492.          }
  493.          if(this.hit2.hitTest(_root.Level["B" add forvar]))
  494.          {
  495.             Blockpuff(forvar);
  496.             if(CSPattack == "elektro" || CSPattack == "Spikes")
  497.             {
  498.                if(this.Kirby._currentframe >= 9)
  499.                {
  500.                   _root.Level["B" add forvar]._visible = 0;
  501.                }
  502.             }
  503.             else if(CSPattack != "stone")
  504.             {
  505.                _root.Level["B" add forvar]._visible = 0;
  506.             }
  507.          }
  508.          else if(this.feet.hitTest(_root.Level["B" add forvar]))
  509.          {
  510.             if(CSPattack == "stone")
  511.             {
  512.                Blockpuff(forvar);
  513.                _root.Level["B" add forvar]._visible = 0;
  514.                YSpeed = 0;
  515.             }
  516.             else if(_root.Level["B" add forvar]._y + _root.Level._y - _root.Level["B" add forvar]._height / 2 >= LastYpos - 10 && LastXPos >= _root.Level["B" add forvar]._x + _root.Level._x - _root.Level["B" add forvar]._width && LastXPos < _root.Level["B" add forvar]._x + _root.Level._x + _root.Level["B" add forvar]._width)
  517.             {
  518.                if(0 >= YSpeed)
  519.                {
  520.                   if(hit == "on4")
  521.                   {
  522.                      hit = "off";
  523.                   }
  524.                   this._y = _root.Level["B" add forvar]._y + _root.Level._y - _root.Level["B" add forvar]._height / 2;
  525.                   if(Fly != "on")
  526.                   {
  527.                      if(YSpeed != 0)
  528.                      {
  529.                         YForm = 60;
  530.                      }
  531.                      isjumping = "off";
  532.                      Ground = "on";
  533.                   }
  534.                   YSpeed = 0;
  535.                }
  536.             }
  537.             else if(LastYpos >= _root.Level["B" add forvar]._y + _root.Level._y + _root.Level["B" add forvar]._height / 2 && _root.Level["B" add forvar]._x + _root.Level._x - _root.Level["B" add forvar]._width < LastXPos && LastXPos < _root.Level["B" add forvar]._x + _root.Level._x + _root.Level["B" add forvar]._width)
  538.             {
  539.                this._y = _root.Level["B" add forvar]._y + _root.Level._y + _root.Level["B" add forvar]._height / 2 + this.feet._height;
  540.                if(Fly != "on")
  541.                {
  542.                   if(0 < YSpeed)
  543.                   {
  544.                      YSpeed = 0;
  545.                   }
  546.                }
  547.             }
  548.             else if(_root.Level["B" add forvar]._y + _root.Level._y - _root.Level["B" add forvar]._height / 2 < LastYpos && LastYpos < _root.Level["B" add forvar]._y + _root.Level._y + _root.Level["B" add forvar]._height / 2)
  549.             {
  550.                if(LastXPos < _root.Level["B" add forvar]._x + _root.Level._x)
  551.                {
  552.                   if(CSPattack == "Crash")
  553.                   {
  554.                      Blockpuff(forvar);
  555.                      _root.Level["B" add forvar]._visible = 0;
  556.                   }
  557.                   else
  558.                   {
  559.                      this._x = _root.Level["B" add forvar]._x + _root.Level._x - _root.Level["B" add forvar]._width / 2 - this.feet._width / 2;
  560.                   }
  561.                }
  562.                else if(CSPattack == "Crash")
  563.                {
  564.                   Blockpuff(forvar);
  565.                   _root.Level["B" add forvar]._visible = 0;
  566.                }
  567.                else
  568.                {
  569.                   this._x = _root.Level["B" add forvar]._x + _root.Level._x + _root.Level["B" add forvar]._width / 2 + this.feet._width / 2;
  570.                }
  571.             }
  572.          }
  573.       }
  574.       forvar++;
  575.    }
  576.    var forvar = 1;
  577.    while(forvar < 10)
  578.    {
  579.       if(_root.Starshoot.hitTest(_root.Level["G" add forvar]))
  580.       {
  581.          _root.Starshoot.Star.gotoAndStop(3);
  582.       }
  583.       if(_root.Level.SPAStar.hitTest(_root.Level["G" add forvar]))
  584.       {
  585.          if(_root.Level.SPAStar.LY >= _root.Level["G" add forvar]._y - 10 && _root.Level["G" add forvar]._y + 10 >= _root.Level.SPAStar.LY)
  586.          {
  587.             if(0 >= _root.Level.SPAStar.Y)
  588.             {
  589.                _root.Level.SPAStar._y = _root.Level["G" add forvar]._y - _root.Level.SPAStar._height / 2;
  590.                _root.Level.SPAStar.Y *= - SPAStarBreak;
  591.             }
  592.          }
  593.          else if(_root.Level.SPAStar.LY >= _root.Level["G" add forvar]._y)
  594.          {
  595.             if(_root.Level.SPAStar.LX < _root.Level["G" add forvar]._x + _root.Level["G" add forvar]._width / 2)
  596.             {
  597.                _root.Level.SPAStar._x = _root.Level["G" add forvar]._x - _root.Level.SPAStar._width / 2;
  598.                _root.Level.SPAStar.X *= - SPAStarBreak;
  599.             }
  600.             else
  601.             {
  602.                _root.Level.SPAStar._x = _root.Level["G" add forvar]._x + _root.Level["G" add forvar]._width + _root.Level.SPAStar._width / 2;
  603.                _root.Level.SPAStar.X *= - SPAStarBreak;
  604.             }
  605.          }
  606.       }
  607.       if(this.feet.hitTest(_root.Level["G" add forvar]))
  608.       {
  609.          if(this._y >= _root.Level["G" add forvar]._y + _root.Level._y - MaxYSpeed && _root.Level["G" add forvar]._y + _root.Level._y + MaxYSpeed >= this._y)
  610.          {
  611.             if(0 >= YSpeed)
  612.             {
  613.                if(hit == "on4")
  614.                {
  615.                   Speed = 0;
  616.                   X = 0;
  617.                   hit = "off";
  618.                }
  619.                this._y = _root.Level["G" add forvar]._y + _root.Level._y;
  620.                if(Fly != "on")
  621.                {
  622.                   if(YSpeed != 0)
  623.                   {
  624.                      YForm = 60;
  625.                   }
  626.                   isjumping = "off";
  627.                   Ground = "on";
  628.                }
  629.                YSpeed = 0;
  630.             }
  631.          }
  632.          else if(this._y >= _root.Level["G" add forvar]._y + _root.Level._y + MaxYSpeed)
  633.          {
  634.             if(this._x < _root.Level["G" add forvar]._x + _root.Level._x + _root.Level["G" add forvar]._width / 2)
  635.             {
  636.                if(CSPattack == "Crash")
  637.                {
  638.                   X = 0;
  639.                   hit = "on3";
  640.                   CSPattack = "off";
  641.                   this._x = _root.Level["G" add forvar]._x + _root.Level._x - this.feet._width;
  642.                }
  643.                else
  644.                {
  645.                   if(Speed != 0)
  646.                   {
  647.                      Speed = 0;
  648.                   }
  649.                   this._x = _root.Level["G" add forvar]._x + _root.Level._x - this.feet._width / 2;
  650.                }
  651.             }
  652.             else if(CSPattack == "Crash")
  653.             {
  654.                X = 0;
  655.                hit = "on3";
  656.                CSPattack = "off";
  657.                this._x = _root.Level["G" add forvar]._x + _root.Level._x + _root.Level["G" add forvar]._width + this.feet._width;
  658.             }
  659.             else
  660.             {
  661.                this._x = _root.Level["G" add forvar]._x + _root.Level._x + _root.Level["G" add forvar]._width + this.feet._width / 2;
  662.             }
  663.          }
  664.       }
  665.       forvar++;
  666.    }
  667.    if(_root.Level.Bogen.hitTest(_X + x,_Y + y,true))
  668.    {
  669.       isjumping = "off";
  670.       Ground = "on";
  671.       Fly = "off";
  672.       YSpeed = -10;
  673.       var forvar = 0;
  674.       while(100 >= forvar)
  675.       {
  676.          this._y -= 1;
  677.          if(!_root.Level.Bogen.hitTest(_X + x,_Y + y,true))
  678.          {
  679.             this._y += 1;
  680.             forvar = 100;
  681.          }
  682.          forvar++;
  683.       }
  684.    }
  685.    if(_root.Door != 0)
  686.    {
  687.       this.gotoAndStop("door1");
  688.       _root.setvarsoff = "on";
  689.       this._x = _root.CdoorX;
  690.       this._y = _root.CdoorY;
  691.    }
  692.    else if(hit == "on3")
  693.    {
  694.       isAttacking = "off";
  695.       YSpeed = 15;
  696.       hit = "on4";
  697.       CSPattack = "off";
  698.       Fly = "off";
  699.       if(0 < this._xscale)
  700.       {
  701.          X = -10;
  702.       }
  703.       else
  704.       {
  705.          X = 10;
  706.       }
  707.       this.gotoAndStop("hit");
  708.    }
  709.    else if(hit == "on")
  710.    {
  711.       isAttacking = "off";
  712.       YSpeed = 0;
  713.       if(0 < this._xscale)
  714.       {
  715.          X = -8;
  716.       }
  717.       else
  718.       {
  719.          X = 8;
  720.       }
  721.       if(SPattack != "off")
  722.       {
  723.          SPhitout = "on";
  724.       }
  725.       CSPattack = "off";
  726.       Fly = "off";
  727.       this.gotoAndStop("hit");
  728.       hit = "on2";
  729.    }
  730.    else if(hit == "on2")
  731.    {
  732.       this._x += X;
  733.       isAttacking = "off";
  734.       Fly = "off";
  735.       CSPattack = "off";
  736.       if(X == 0)
  737.       {
  738.          Speed = 0;
  739.          hit = "off";
  740.       }
  741.       this.gotoAndStop("hit");
  742.    }
  743.    else if(hit == "on4")
  744.    {
  745.       if(0 < this._xscale)
  746.       {
  747.          X = -4;
  748.       }
  749.       else
  750.       {
  751.          X = 4;
  752.       }
  753.       isAttacking = "off";
  754.       Fly = "off";
  755.       CSPattack = "off";
  756.       if(Ground == "On")
  757.       {
  758.          Speed = 0;
  759.          hit = "off";
  760.       }
  761.       this.gotoAndStop("hit");
  762.    }
  763.    else if(attackDemo != "off")
  764.    {
  765.       this.gotoAndStop("attackDemo");
  766.       if(1 >= this.Kirby._currentframe)
  767.       {
  768.          if(this._yscale >= 90 && YForm >= 100)
  769.          {
  770.             this.Kirby.gotoAndPlay(attackdemo);
  771.          }
  772.          else
  773.          {
  774.             this.Kirby.gotoAndStop("1");
  775.          }
  776.       }
  777.       if(this.Kirby._currentframe == 2 && this._currentframe == 75)
  778.       {
  779.          attackDemo = "off";
  780.       }
  781.       YSpeed = 0;
  782.       Speed = 0;
  783.    }
  784.    else if(CSPattack == "stone" || CSPattack == "elektro" || CSPattack == "Spikes")
  785.    {
  786.       this.gotoAndStop("attack" add CSPattack);
  787.       if(this.Kirby._currentframe < 9)
  788.       {
  789.          if(CSPattack != "Beam")
  790.          {
  791.             YSpeed = 0;
  792.          }
  793.          Speed = 0;
  794.       }
  795.    }
  796.    else if(CSPattack == "fire")
  797.    {
  798.       if(!Key.isDown(attack))
  799.       {
  800.          isAttacking = "off";
  801.          if(this.Kirby._currentframe < 40)
  802.          {
  803.             this.Kirby.gotoAndPlay("off");
  804.          }
  805.       }
  806.       this.gotoAndStop("attack" add CSPattack);
  807.       if(this.Kirby._currentframe < 9)
  808.       {
  809.          if(Ground == "on")
  810.          {
  811.             Speed = 0;
  812.          }
  813.       }
  814.    }
  815.    else if(CSPattack == "SwordJump" || CSPattack == "Beam" || CSPattack == "Boomerang")
  816.    {
  817.       this.gotoAndStop("attack" add CSPattack);
  818.       if(this.Kirby._currentframe >= this.Kirby._totalframes)
  819.       {
  820.          isAttacking = "off";
  821.          CSPattack = "off";
  822.       }
  823.    }
  824.    else if(CSPattack == "Crash" || CSPattack == "on2" && SPattack == "Crash")
  825.    {
  826.       this.gotoAndStop("attack" add CSPattack);
  827.       YSpeed = 0;
  828.       if(0 < this._xscale)
  829.       {
  830.          X = 15;
  831.       }
  832.       else
  833.       {
  834.          X = -15;
  835.       }
  836.       if(this.Kirby._currentframe >= this.Kirby._totalframes)
  837.       {
  838.          isAttacking = "off";
  839.          CSPattack = "off";
  840.       }
  841.    }
  842.    else if(CSPattack == "Sword")
  843.    {
  844.       this.gotoAndStop("attack" add CSPattack);
  845.       Speed = 0;
  846.       if(this.Kirby._currentframe >= this.Kirby._totalframes)
  847.       {
  848.          isAttacking = "off";
  849.          CSPattack = "off";
  850.       }
  851.    }
  852.    else if(CSPattack == "on2")
  853.    {
  854.       if(this._currentframe < 75)
  855.       {
  856.          CSPattack = "off";
  857.       }
  858.       if(SPattack == "Sword")
  859.       {
  860.          if(this.Kirby._currentframe >= this.Kirby._totalframes)
  861.          {
  862.             isAttacking = "off";
  863.             CSPattack = "off";
  864.          }
  865.       }
  866.       else if(this.Kirby._currentframe < 40 && this.Kirby._currentframe >= 15)
  867.       {
  868.          this.Kirby.gotoAndPlay("off");
  869.       }
  870.       else if(this.Kirby._currentframe >= this.Kirby._totalframes)
  871.       {
  872.          CSPattack = "off";
  873.       }
  874.    }
  875.    else if(Fly == "on")
  876.    {
  877.       this.gotoAndStop("Fly");
  878.    }
  879.    else if(Fly == "on2")
  880.    {
  881.       if(this.Kirby._currentframe < 30)
  882.       {
  883.          _root.Puhh.gotoAndPlay(1);
  884.          _root.Puhh._x = this._x;
  885.          _root.Puhh._y = this._y;
  886.          _root.Puhh._xscale = this._xscale;
  887.          this.Kirby.gotoAndPlay(30);
  888.       }
  889.       else if(this.Kirby._currentframe >= 35)
  890.       {
  891.          Fly = "off";
  892.       }
  893.    }
  894.    else if(isAttacking == "on")
  895.    {
  896.       if(SPattack == "off")
  897.       {
  898.          this.gotoAndStop("inhale");
  899.       }
  900.    }
  901.    else if(isAttacking == "on2")
  902.    {
  903.       if(this.Kirby._currentframe < 20)
  904.       {
  905.          this.Kirby.play();
  906.       }
  907.       else
  908.       {
  909.          isAttacking = "off";
  910.       }
  911.    }
  912.    else if(spit == "on")
  913.    {
  914.       this.gotoAndStop("spit");
  915.       if(this.Kirby._currentframe == 1)
  916.       {
  917.          _root.Starshoot._x = this._x;
  918.          _root.Starshoot._y = this._y;
  919.          _root.Starshoot._xscale = this._xscale;
  920.          _root.Starshoot.gotoAndPlay(1);
  921.       }
  922.       else if(this.Kirby._currentframe >= 7)
  923.       {
  924.          spit = "off";
  925.          fat = "off";
  926.       }
  927.    }
  928.    else if(ground == "off")
  929.    {
  930.       if(isjumping == "on")
  931.       {
  932.          if(Fat == "on")
  933.          {
  934.             this.gotoAndStop("JumpFat");
  935.          }
  936.          else
  937.          {
  938.             this.gotoAndStop("Jump");
  939.             if(this.Kirby._currentframe == 1)
  940.             {
  941.                if(YSpeed < 2)
  942.                {
  943.                   this.Kirby.play();
  944.                }
  945.             }
  946.          }
  947.       }
  948.    }
  949.    else if(Speed == 0)
  950.    {
  951.       if(Fat == "on")
  952.       {
  953.          this.gotoAndStop("StandFat");
  954.       }
  955.       else
  956.       {
  957.          this.gotoAndStop("Stand");
  958.       }
  959.    }
  960.    else if(Fat == "on")
  961.    {
  962.       this.gotoAndStop("walkfat");
  963.    }
  964.    else if(run == "on")
  965.    {
  966.       this.gotoAndStop("run");
  967.    }
  968.    else
  969.    {
  970.       this.gotoAndStop("walk");
  971.    }
  972.    if(YForm == 100)
  973.    {
  974.       if(this._yscale < 95)
  975.       {
  976.          this._yscale += 25;
  977.       }
  978.       else
  979.       {
  980.          this._yscale = 100;
  981.       }
  982.    }
  983.    else if(YForm < 100)
  984.    {
  985.       if(YForm >= this._yscale)
  986.       {
  987.          YForm = 100;
  988.       }
  989.       else
  990.       {
  991.          this._yscale -= 20;
  992.       }
  993.    }
  994.    LastXpos = this._x;
  995.    LastYpos = this._y;
  996.    if(Die != "on")
  997.    {
  998.       if(Movwidth - XMSpace < this._x)
  999.       {
  1000.          _root.Level._x -= this._x - (Movwidth - XMSpace);
  1001.          _root.Starshoot._x -= this._x - (Movwidth - XMSpace);
  1002.          _root.Puhh._x -= this._x - (Movwidth - XMSpace);
  1003.          _root.SPAttackStar._x -= this._x - (Movwidth - XMSpace);
  1004.          this._x = Movwidth - XMSpace;
  1005.       }
  1006.       else if(this._x < XMSpace)
  1007.       {
  1008.          _root.Level._x -= this._x - XMSpace;
  1009.          _root.Starshoot._x -= this._x - XMSpace;
  1010.          _root.Puhh._x -= this._x - XMSpace;
  1011.          _root.SPAttackStar._x -= this._x - XMSpace;
  1012.          this._x = XMSpace;
  1013.       }
  1014.       if(Ypos == "disabled")
  1015.       {
  1016.          if(this._y < 15)
  1017.          {
  1018.             this._y = 15;
  1019.          }
  1020.          _root.Level._y = 0;
  1021.       }
  1022.       else if(Movheight - YMSpaceD < this._y)
  1023.       {
  1024.          _root.Level._y -= this._y - (Movheight - YMSpaceD);
  1025.          _root.Starshoot._y -= this._y - (Movheight - YMSpaceD);
  1026.          _root.Puhh._y -= this._y - (Movheight - YMSpaceD);
  1027.          _root.SPAttackStar._y -= this._y - (Movheight - YMSpaceD);
  1028.          this._y = Movheight - YMSpaceD;
  1029.       }
  1030.       else if(this._y < YMSpace)
  1031.       {
  1032.          _root.Level._y -= this._y - YMSpace;
  1033.          _root.Starshoot._y -= this._y - YMSpace;
  1034.          _root.Puhh._y -= this._y - YMSpace;
  1035.          _root.SPAttackStar._y -= this._y - YMSpace;
  1036.          this._y = YMSpace;
  1037.       }
  1038.    }
  1039.    _root.Level.SPAStar.Y -= 0.5;
  1040.    _root.Level.SPAStar.LY = _root.Level.SPAStar._y;
  1041.    _root.Level.SPAStar.LX = _root.Level.SPAStar._x;
  1042.    _root.Level.SPAStar._y -= _root.Level.SPAStar.Y;
  1043.    _root.Level.SPAStar._x += _root.Level.SPAStar.X / 2;
  1044. }
  1045.